<!DOCTYPE html>
<html lang="en-US">
<!--********************************************-->
<!--*       Generated from PreTeXt source      *-->
<!--*                                          *-->
<!--*         https://pretextbook.org          *-->
<!--*                                          *-->
<!--********************************************-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
</head>
<body class="ignore-math"><article class="example example-like"><dfn class="terminology">Example 1</dfn> Find the general solution of the following ODE:<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime}+\frac{y}{x}=3 \cos (2x), \quad x &gt; 0.
\end{equation*}
</div>
<dfn class="terminology">Solution:</dfn> Since <span class="process-math">\(p(x)=\frac{1}{x}\text{,}\)</span> the integrating factor is<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
u(x)=\exp \left(\int p(x) \textrm{d} x\right)=\exp  \left( \int \frac{1}{x} \textrm{d} x \right)=\exp\left(\ln x \right)=x.
\end{equation*}
</div>Then multiplying the integrating factor <span class="process-math">\(u(x)\)</span> on both sides , one has<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
x y^{\prime}+y=3 x \cos (2x)  \rightarrow \frac{\textrm{d}}{\textrm{d} x} (xy)=3 x \cos (2x)  \rightarrow   xy=\int (3 x \cos (2 x)) \textrm{d} x+C=\frac{3}{2} x \sin (2 x)+\frac{3}{4} \cos (2 x)+C.
\end{equation*}
</div>Therefore, the general solution is<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y=\frac{\frac{3}{2} x \sin (2 x)+\frac{3}{4} \cos (2 x)+C}{x}.
\end{equation*}
</div></article></body>
</html>
